Constructing Precise Control Flow Graphs from Binaries
نویسندگان
چکیده
Third-party software is often distributed only in binary form. For software engineering or security considerations, it is important to be able to analyze binaries. One fundamental obstacle to perform binary analysis is the lack of precise control flow information. Existing techniques to construct control flow of binaries are either static or dynamic. Traditional static techniques usually disassemble a program’s binary image statically and build the control flow graph (CFG) from the assembly-level representation of the program. They are limited in precision because of difficulty in statically resolving indirect branches. Dynamic techniques, on the other hand, suffer from poor coverage and scalability. Hybrid techniques based on combined dynamic and symbolic path exploration can be used to improve code coverage, but still suffer from poor coverage and scalability because they rely on expensive constraint solving to generate alternative inputs to explore different control flow paths. This paper presents the first practical technique that constructs precise control flow graphs from binaries. Our technique rests on the key observation that the possible targets of most indirect branches are independent of intermediate program states, and thus by systematically forcing a program’s execution to explore both branches of each conditional, we can discover the program’s precise control flow. Specifically, we run the program under analysis in a controlled virtual environment. At each conditional branch, we save the address of the path not taken, and force the execution to explore that path later. In essence, we leverage both dynamic execution to compute the targets of indirect branches (as in traditional dynamic CFG construction) and efficient (since it is forced) systematic exploration specifically targeting the problem of control flow construction from binaries. We also introduce effective optimizations and heuristics to make our dynamic forced execution scalable and practical. We have implemented our technique in a practical tool FXE for x86 binaries and performed detailed evaluation of its precision, generality, and performance. Our results show that FXE constructs highly precise CFGs and scales to real-world programs, significantly outperforming state-of-the-art alternatives.
منابع مشابه
An Improved Method on Static Binary Analysis to Enhance the Context-Sensitive CFI
Control Flow Integrity (CFI) is one of the most promising technique to defend Code-Reuse Attacks (CRAs). Traditional CFI Systems and recent Context-Sensitive CFI use coarse control flow graphs (CFGs) to analyze whether the control flow hijack occurs, left vast space for attackers at indirect call-sites. Coarse CFGs make it difficult to decide which target to execute at indirect control-flow tra...
متن کاملThe Graphs of Structured Programming
Control flow graphs represent the possible execution paths of a program and can be obtained by static analysis of software binaries. We give a formal characterization of the subclass of control flow graphs that correspond to structured code.
متن کاملAn Abstract Interpretation-Based Framework for Control Flow Reconstruction from Binaries
Due to indirect branch instructions, analyses on executables commonly suffer from the problem that a complete control flow graph of the program is not available. Data flow analysis has been proposed before to statically determine branch targets in many cases, yet a generic strategy without assumptions on compiler idioms or debug information is lacking. We have devised an abstract interpretation...
متن کاملGeneration of Control and Data Flow Graphs from Scheduled and Pipelined Assembly Code
High-level synthesis tools generally convert abstract designs described in a high-level language into a control and data flow graph (CDFG), which is then optimized and mapped to hardware. However, there has been little work on generating CDFGs from highly pipelined software binaries, which complicate the problem of determining data flow propagation and dependencies. This paper presents a method...
متن کاملX-Force: Force-Executing Binary Programs for Security Applications
This paper introduces X-Force, a novel binary analysis engine. Given a potentially malicious binary executable, X-Force can force the binary to execute requiring no inputs or proper environment. It also explores different execution paths inside the binary by systematically forcing the branch outcomes of a very small set of conditional control transfer instructions. X-Force features a crash-free...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2010